function scatterTest
xdata=5*rand(1,100);
ydata=5*rand(1,100);
figure,scatter(xdata,ydata);
hold on;
rect=getrect;
rectpolyx=[rect(1) rect(1) rect(1)+rect(3) rect(1)+rect(3) rect(1)];
rectpolyy=[rect(2) rect(2)+rect(4) rect(2)+rect(4) rect(2) rect(2)];
in = inpolygon(xdata,ydata,rectpolyx,rectpolyy);
plot(rectpolyx,rectpolyy,xdata(in==1),ydata(in==1),'x','color','red');